package com.study.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import com.study.beans.User;
import com.study.service.UserClientService;

@RestController
public class ConsumerController {
	
	@Autowired
	private UserClientService service;
	
	@GetMapping("/consumer/add")
	public boolean add(User user) {
		return service.add(user);
	}
	
	@GetMapping("/consumer/get/{id}")
	public User get(@PathVariable("id") Integer id) {
		return service.get(id);
	}
	
	@GetMapping("/consumer/list")
	public List<User> list() {
		return service.list();
	}
}
